<?php

namespace App\Models;

use App\Enums\PublishTaskStatusEnum;
use App\Jobs\UserCreatedJob;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
class UserModel extends Authenticatable implements JWTSubject
{
    use HasDateTimeFormatter;
    use SoftDeletes;

    protected $guarded = ['id'];
    protected $table = 'users';


    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    public function getJWTCustomClaims()
    {
        return ['role' => 'api'];  //注意这里的名称api

    }


}
